import Taro, { Component } from "@tarojs/taro"
import { View,Text } from "@tarojs/components"
import '../../colorui/main.wxss'
import '../../colorui/icon.wxss' 
import './index.less'

export default class Login extends Component {
  
  componentWillMount() { }

  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }
  
  onClose(){
console.log('this.onClose')
this.props.onClose()
  }
  
  render() {
    if (this.props.show) {
      return (
        <View className='cu-modal show'>
          <View className='cu-dialog'>
            <View className='cu-bar bg-white justify-end'>
                <View className='content'>{this.props.title}</View>
                <View className='action'>
                  <Text onClick={this.onClose} className='cuIcon-close text-red'></Text>
                </View>
            </View>
            <View>
            {this.props.children}
            </View>
           
          </View>
        </View>
      )
    }
    return null

  }
}
